package com.wf.controller;

import com.wf.service.LoginService;
import com.wf.vo.Result;
import com.wf.vo.params.RegisterParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/register")
//@CrossOrigin(origins = {"http://localhost:5173", "http://localhost:5174"})
public class RegisterController {

    @Autowired
    private LoginService loginService;

    @PostMapping
    public Result register(@RequestBody RegisterParam registerParam){
        log.info("接收到注册请求："+registerParam.toString());
        return loginService.register(registerParam);
    }
}
